// 拖转进入
export const dragEnterSplit = function (e, index, item) {
  this.$emit('setMouseHoverItem', item)
}
// 在元素上释放
export const drop = function (e, index) {
  this.$emit('setMouseHoverItem', {})
  if(['split'].includes(this.curFormObj.type)) {return false } // 栅格里面不允许继续放栅格
  const item = {
    ...this.item,
    children: this.item.children.map((k, i) => {
      if(i == index) {
        const { id, span } = k
        return { id, span, ...this.curFormObj }
      }
      return k
    })
  }
  this.$emit('setItem', item)
  const formData = _.searchCover(_.deepCopy(this.formData), {id: this.item.id}, v => item)
  this.$emit('setFormData', formData)
}
// 添加条目
export const addItem = function () {
  
}
// 调整字段值
export const changeField = function (e, field) {
  // e = e || ''
  // const value = isString(e) || isNumber(e) || isArray(e) ? e : e.target.value
  // // 更新右侧的值
  // const item = {...this.item, [field]: value}
  // this.$emit('setItem', item)
  // // 更新整体表单的值
  // const formData = searchCover(this.formData, {id: this.item.id}, v => ({...v, [field]: value}))
  // this.$emit('setFormData', formData)
}
// 选择当前条目
export const selectItem = function (col) {
  this.$emit('setCheckedItem', col)
}